Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resizing grid for extra cells #6072

Merged
merged 5 commits into from
Jul 12, 2024
Merged

Fix resizing grid for extra cells #6072

merged 5 commits into from
Jul 12, 2024

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Jul 12, 2024

Problem:

If a grid contains more cell elements than what's declared in the grid template, the grid resize stops working for the overflowing rows/columns.

For example, try to resize the last column in this grid https://utopia.fish/p/c6133e47-eight-cork

Fix:

  1. Do not rely on the gird template from props but only the calculated grid values, which are the same used in the other grid strategies (e.g. to display the grid shadows)
  2. For now, just stick to converting everything to calculated units (e.g. resizing a fr unit will transform the template to px) - I think it's ok for now until we decide how to tackle those cases, and we have to deal with simpler code in the meantime
  3. When the grid is resized, apply the new "fixed" templates too (so if you have an actual grid that contradicts the template, update the template accordingly).

Fix #6071

Copy link
Contributor

github-actions bot commented Jul 12, 2024

Try me

Copy link

relativeci bot commented Jul 12, 2024

#13359 Bundle Size — 62.64MiB (-0.02%).

3307243(current) vs 6339ece master#13355(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 7 changes Regression 1 regression Improvement 1 improvement
                 Current
#13359
     Baseline
#13355
Regression  Initial JS 45.71MiB(~+0.01%) 45.71MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 19.25% 21.6%
Change  Chunks 31(+3.33%) 30
Change  Assets 34(+3.03%) 33
Change  Modules 4371(-0.07%) 4374
Improvement  Duplicate Modules 521(-0.57%) 524
Change  Duplicate Code 31.68%(-0.06%) 31.7%
No change  Packages 469 469
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Improvement 2 improvements
                 Current
#13359
     Baseline
#13355
Improvement  JS 62.63MiB (-0.02%) 62.65MiB
Improvement  HTML 11.16KiB (-0.33%) 11.2KiB

Bundle analysis reportBranch fix/resize-grid-extra-cellsProject dashboard

@ruggi ruggi merged commit 91a17fa into master Jul 12, 2024
14 checks passed
@ruggi ruggi deleted the fix/resize-grid-extra-cells branch July 12, 2024 14:34
liady pushed a commit that referenced this pull request Dec 13, 2024
**Problem:**

If a grid contains more cell elements than what's declared in the grid
template, the grid resize stops working for the overflowing
rows/columns.

For example, try to resize the last column in this grid
https://utopia.fish/p/c6133e47-eight-cork

**Fix:**

1. Do not rely on the gird template from props but only the calculated
grid values, which are the same used in the other grid strategies (e.g.
to display the grid shadows)
2. For now, just stick to converting everything to calculated units
(e.g. resizing a `fr` unit will transform the template to `px`) - I
think it's ok for now until we decide how to tackle those cases, and we
have to deal with simpler code in the meantime
3. When the grid is resized, apply the new "fixed" templates too (so if
you have an actual grid that contradicts the template, update the
template accordingly).

Fix #6071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot resize grid rows/cols that don't match the template
3 participants